<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8" />
    <title>临沂市消防监控系统</title>
    <link rel="stylesheet" href="../lib/css/bootstrop.css" />
    <link rel="stylesheet" href="../css/header.css">
    <link rel="stylesheet" href="../css/login.css">
    <link rel="stylesheet" href="../css/from.css">
    <link rel="stylesheet" href="../css/fire_two.css">
    <script src="../lib/js/uilt.config.js"></script>
    <script type="text/javascript" src="https://webapi.amap.com/maps?v=1.4.10&key=62aefed2dd623a0f5042245bf44f362f"></script>
</head>

<body>
<div class="con">
    <div class="head">
        <div class="row">
            <div class="col-md-3 text-center">
                <div class="head-time background">
                    2018年10月11号 16:23：21
                </div>
            </div>
            <div class="col-md-6 text-center">
                <div class="head-bt background">
                    消防联动预警平台
                </div>
            </div>
            <div class="col-md-3 text-right">
                <div class="head-add background text-center">消防一中队</div>
                <div class="head-btn background text-center"><a href="#">退出</a></div>
            </div>
        </div>
    </div>
    <div class="first-main">
        <div class="row">
            <div class="col-md-8">
                <div class="first-main-map background">
                    <div id="container" style="width: 100%;height: 100%;border-radius: 20px;" class="containerMap"></div>
                    <div class="trap-left"></div>
                    <div class="trap-right"></div>
                </div>
                <div class="first-list background">
                    <div class="list-bt">
                        <img src="../images/main_ld.png">
                        <p>报警信息显示列表</p>
                    </div>
                    <div class="list-nr">
                        <table class="text-center">
                            <thead>
                            <tr>
                                <th>编号</th>
                                <th>类型</th>
                                <th>名称</th>
                                <th>负责人</th>
                                <th>联系电话</th>
                                <th>状态</th>
                                <th>备注</th>
                            </tr>
                            </thead>
                            <tbody>
                            <tr>
                                <td>0001</td>
                                <td>xx社区消防站</td>
                                <td>社区</td>
                                <td>王倩倩</td>
                                <td>1878909887</td>
                                <td><span>已接收</span></td>
                                <td>A社区7号楼3单元</td>
                            </tr>
                            <tr>
                                <td>0001</td>
                                <td>xx社区消防站</td>
                                <td>社区</td>
                                <td>王倩倩</td>
                                <td>1878909887</td>
                                <td><span>已接收</span></td>
                                <td>A社区7号楼3单元</td>
                            </tr>
                            <tr>
                                <td>0001</td>
                                <td>xx社区消防站</td>
                                <td>社区</td>
                                <td>王倩倩</td>
                                <td>1878909887</td>
                                <td><span>已接收</span></td>
                                <td>A社区7号楼3单元</td>
                            </tr>
                            <tr>
                                <td>0001</td>
                                <td>xx社区消防站</td>
                                <td>社区</td>
                                <td>王倩倩</td>
                                <td>1878909887</td>
                                <td><span>已接收</span></td>
                                <td>A社区7号楼3单元</td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
            <div class="col-md-4 first-list-nr">
                <div class="two_list-nr background">
                    <ul>
                        <li>
                            <p>值班领导：</p><span>李建国</span>
                            <div class="ld-peo">
                                <span>汤森</span>
                                <span>汤森</span>
                                <span>汤森</span>
                                <span>汤森</span>
                                <span>汤森</span>
                                <span>汤森</span>
                                <span>汤森</span>
                                <span>汤森</span>
                            </div>
                        </li>
                        <li>
                            <p>通讯员：</p><span>张三</span>
                            <div class="ld-peo">
                                <span>汤森</span>
                                <span>汤森</span>
                                <span>汤森</span>
                                <span>汤森</span>
                                <span>汤森</span>
                                <span>汤森</span>
                                <span>汤森</span>
                                <span>汤森</span>
                            </div>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
</div>

</body>
<script src="../lib/js/jquery-3.1.1.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../lib/js/bootstrap.min.js"></script>
<script>
    var form=[],
        time='',
        map='',
        FireNumer='',//火灾编号
        Pointlng= '',//经度
        PointLat= '',//纬度
        loading='',
        CreateTime='',
        FirePageInfo=[],//存储火灾信息
        arrNotifyInfo=[],//存储根据火灾编号，获取通知的微站信息
        createTime='';//火灾创建时间

    $(function () {

        bind()
        createTime = getLocalTime()
        ajaxFirePageInfo();
        ajaxGetNotifyInfo();
        ajaxEstablishInfo();

        // var cd =  todayTime()
        //console.log(cd)
    })
    var clickListener, map = new AMap.Map('container', {
        resizeEnable: true,
        center: [118.301306,35.190822] //初始化地图中心点
    });
    //bt1的click的绑定事件
    var bind = function() {
        remove(); //防止重复绑定
        clickListener = AMap.event.addListener(map, "click", function(e) {
            debugger;
            Pointlng = e.lnglat.getLng()
            PointLat = e.lnglat.getLat()
            new AMap.Marker({
                position: e.lnglat,
                map: map
            });
        });
    };
    //bt2的click的绑定事件
    var remove = function() {
        if (clickListener) {
            AMap.event.removeListener(clickListener);//移除事件，以绑定时返回的对象作为参数
        }
    };


    function ajaxFirePageInfo(){
        $.ajax({
            type: 'post',
            url: 'http://221.2.74.114:18801/FireInfoApi/QueryFirePageInfoByFireNumer',
            data: JSON.stringify({ FireNumer: createTime }),
            dataType:'json',
            contentType: 'application/json',
            success: function (msg) {
                console.log(msg)
                if (msg.state == 1) {

                }else {

                }

            }, error: function (XMLHttpRequest, textStatus, errorThrown) {
                console.log(XMLHttpRequest, textStatus, errorThrown)
            }
        });
    }
    //根据火灾编号，获取通知的微站信息
    function ajaxGetNotifyInfo(){
        $.ajax({
            type: 'post',
            url: 'http://221.2.74.114:18801/FireNotifyApi/GetNotifyInfoByFireNumber',
            data: JSON.stringify({Pointlng:Pointlng,PointLat:PointLat,CoordinateType:'gaode',FireNumber: createTime }),
            dataType:'json',
            contentType: 'application/json',
            success: function (msg) {
                console.log(msg)
                if (msg.state == 1) {
                    arrNotifyInfo = msg.data
                    for (var i = 0;i < msg.data.length;i++) {
                        var x =  msg.data[i].Gaode_coordinate.split(',')[0]
                        var y =  msg.data[i].Gaode_coordinate.split(',')[1]
                    }
                }else {

                }

            }, error: function (XMLHttpRequest, textStatus, errorThrown) {
                console.log(XMLHttpRequest, textStatus, errorThrown)
            }
        });
    }
    function ajaxEstablishInfo(){
        $.ajax({
            type: 'post',
            url: 'http://221.2.74.114:18801/FireInfoApi/GetFireInfoByFireNumer',
            data: JSON.stringify({Pointlng:Pointlng,PointLat:PointLat,CoordinateType:'gaode',FireNumber: createTime,CreateTime:CreateTime,SentUnit:'SentUnit',FireAddress:'SentUnit' }),
            dataType:'json',
            contentType: 'application/json',
            success: function (msg) {
                console.log(msg)
                if (msg.state == 1) {
                    arrNotifyInfo = msg.data
                    for (var i = 0;i < msg.data.length;i++) {
                        var x =  msg.data[i].Gaode_coordinate.split(',')[0]
                        var y =  msg.data[i].Gaode_coordinate.split(',')[1]
                    }
                }else {

                }

            }, error: function (XMLHttpRequest, textStatus, errorThrown) {
                console.log(XMLHttpRequest, textStatus, errorThrown)
            }
        });
    }
</script>
</html>